#include <cstdio>
#include <cmath>

using namespace std;

typedef long long ll;

const int maxn=1772586;

int main() {
  ll k;
  scanf("%lld", &k);

  int l=sqrt(k*3.141)-100, r=sqrt(k*3.142)+100, mid;
  static int ans[maxn+1];
  for (; l<=r; ) {
    mid = (l+r)/2;
    ll sum=mid+k;
    for (int i=1; i<mid && sum; i++) {
      ans[i] = i-(sum-1)%(i+1);
      sum /= (i+1);
    }
    if (sum==1) break;
    else if (sum) l = mid+1;
    else r = mid-1;
  }

  printf("%d\n", mid);
  for (int i=1; i<=mid; i++) printf("%d ", ans[i]);

  fclose(stdin);
  fclose(stdout);
  return 0;
}
